Drongo's Command Enhancement
v0.522

by Drongo
29 July 2024

Discord for my mods: https://discord.gg/XSRHPEd

REQUIREMENTS
Arma 3
CBA for Arma 3


OVERVIEW
DCE gives you quick, powerful and intuitive control over your squad and AI groups. Turn Arma 3 into a hybrid FPS/RTT experience. Issue commands, receive contact reports, seize objectives and call in reinforcements.


SETUP
Make sure that the DCE key is bound ("Window App" by default, change under CONFIGURE > CONTROLS > CONFIGURE ADDONS in mission). Also check the bindings for DCE interact and DCE action under the same menu.

If you want to use vanilla High Command options, then place a BIS "High Command - Commander" Module on the map. Do not sync it to anything. As of version 018 command and attach are enabled by default. To disable them use these commands:

dceCommandEnabled = false;
dceAttachEnabled = false;

You can disable the entire system for a specific player by setting dceAvailable=false on their client.

There is an options module under Modules > DCE > * Options *. This allows customizing features. Also, any players synced to this module will have access to the Command Menu, even if Command is disabled in the module.


USING IN GAME
To bring up the menu, hit your DCE key. Most of the buttons and functions are self-explanatory or can be learned by playing around in the editor for a few minutes.

As of version 018 there are two new keys you can use:

Interact can run a script based on what is under the cursor. It can be defined by the mission editor by defining dce_fnc_KeyPressedInteract (start with _target = cursorTarget;).

dce_fnc_KeyPressedSpecial can be used for any script the editor wishes.

As of version 024 there is a new key:

DCE\Scripts\Core\KeyPressed.sqf (allows entering vehicles and switching to driver/gunner with R_SHIFT)


SQUAD MENU
This is primarily for quick, one-click orders when you are a squad leader. There also extra commands such as garrisoning rooftops, deploying statics, switching to any group member and other options.


COMMAND MENU
A command engine that allows a commander to give a variety of orders to any group on his side. Click the help button for more information. Requires a radio to access. To give move orders, select a group from the menu. Then shift click on the map to set a waypoint. High Command orders also work.

If you alt-click on a building, the selected group will attempt to garrison that building (all previous waypoints will be ignored). If you alt-click on a transport vehicle, the selected group will attempt to board that vehicle (all previous waypoints will be ignored).


EXCLUDING GROUPS FROM COMMAND
To exclude a group from command, add it to the array dceExcludedGroups. This array is initialised 3-4 seconds after the mission starts, make sure you want until after this time. You can put the following script in a unit's init line in the editor to exclude it:

(group this) execVM "DCE\Scripts\Core\ExcludeGroup.sqf";

If DCE is already initialized, you can use the function

_group call dce_fnc_ExcludeGroup;

Because markers are handled by BIS High Command, the group's marker will still be visible on the map. However, the group will not appear in the command dialog and can not be given orders.


CONTACT REPORTS
Contact reports can be disabled by setting dceReportContact=FALSE;. A simple way to do this is to run the following script on a client:

execVM"DCE\Scripts\Core\DisableReports.sqf


The knowsAbout threshold can be changed mid-mission with the following variables:
// https://community.bistudio.com/wiki/knowsAbout

dceSpotThresholdWest=2;
dceSpotThresholdEast=2;
dceSpotThresholdRes=2;

Max range from a spotter than a spotter can detect and report a contact:

dceSpotRangeWest=1500;
dceSpotRangeEast=1500;
dceSpotRangeRes=1500;


This variable is the seconds between updating enemy markers:

dceEnemyMarkerDelay=1;

TELEPORT
Teleport can be disabled by setting dceTeleport=FALSE;


USING WITH DRONGOS ARTILLERY AND DRONGOS AIR OPS
Make sure that the DCE key and the DRA and DAO keys are bound to different keys.


FUNCTION KEYS
The squad menu features function keys F1 to F8. By default, these do nothing. However, a mission or addon maker can access them by defining the following functions:

dceS_fnc_FunctionKey1
dceS_fnc_FunctionKey2
dceS_fnc_FunctionKey3
dceS_fnc_FunctionKey4
dceS_fnc_FunctionKey5
dceS_fnc_FunctionKey6
dceS_fnc_FunctionKey7
dceS_fnc_FunctionKey8

For example, if a mission maker wishes to add a script called MY_SCRIPT.sqf to F1, he should use the following code:

dceS_fnc_FunctionKey1 = compile preprocessFile "MY_SCRIPT.sqf";

You can also assign a text name to each key using the following variables:

dceS_NameF1 = "";
dceS_NameF2 = "";
dceS_NameF3 = "";
dceS_NameF4 = "";
dceS_NameF5 = "";
dceS_NameF6 = "";
dceS_NameF7 = "";
dceS_NameF8 = "";

For example:

dceS_NameF1 = "Action one";
dceS_NameF2 = "Heal";
dceS_NameF3 = "";
dceS_NameF4 = "Help";

IMPORTANT: Do not put this code in init.sqf. When DCE loads, it assigns an empty function to each function key. To make sure they are overwritten, redefine the functions at least 5 seconds after the start of the mission or use the global variable dceReady.


ATTACH/DETACH
As of release 0.15 the command menu features an "Attach" option. Clicking this will give a menu allowing attaching elements between groups. Select a group from the left-hand list (group A), then select a target group from the right-hand list (group B).


All >>: Transfer all units from group A to group B.
Dismounts >>: Transfer all men not in a vehicle to group B.
Vehicles >>: Transfer all men crewing vehicles (ie. commander, gunner or driver, NOT cargo) to join group B.
Man >>: Select a single man from the list under the right-hand group list, then select a group on the right. The man will transfer to the target group. If the man is crewing a vehicle, all other crew in the vehicle will also transfer to the same group.

By default, groups must be within 200 meters of each other to attach/detach (as measured from leader to leader). This can be altered with the global variable:

dceAttachDistance = 200;

Detaching works differently. It is not necessary to select a group B. The elements of group A will form a new group.
Man: Select a single man from the list under the right-hand group list. The man will transfer to a new group. If the man is crewing a vehicle, all other crew in the vehicle will also transfer to the same group.
Dismounts: Assign all men not in a vehicle to a new group.
Vehicles: Assign all men crewing vehicles (ie. commander, gunner or driver, NOT cargo) to a new group.


REINFORCEMENTS
This set of modules allows you to spawn in groups at user-defined positions. There is a simple resource system. Editors can easily build their own lists with the modules provided. Place a [DRE] Enable reinforcements module and place [DRE] Spawn point modules at the desired locations for each required side. Objective modules can also be placed to generate income.

If a unit is spawned that does not have the correct spawn point defined, it will find the first suitable spawn point for its side.


ZEUS
As of v0.4, tablet F6 enables Zeus. This can be disabled at the client level with dceZeus=FALSE;.


TACVIEW (Tablet F1 to start)
This is an RTS-style interface based off Zeus, with some limitations. It can be disabled in the options module. It is possible to switch between regular Zeus mode and TacView by clicking the Fn key at the bottom of the Command Menu. TacView is opened with the default Zeus key. Functions:

Right click to add a waypoint.
Ctrl-right click to add a chain of waypoints.
Adding a waypoint over a friendly vehicle will tell the group to mount that vehicle.
Adding a waypoint over a building will tell the group to garrison that building.
Double-clicking a unit will center the camera on the group leader.
Selecting a group from the left side menu while the map is shown will center on that group.
Enemy units will not be visible in TacView unless a friendly group knows of the unit.
The selected group in TacView will be shared with DCE command, allowing the DCE command menu to be used (for dismounting etc).
If a player uses teamSwitch to change units, TacView should transfer across. If it does not, click the button to the right of the Fn button on the Command dialog.

In the future I hope to add correct unit markers to TacView.
There is a sporadic bug where troops ordered to garrison a building refuse to leave. A workaround is to switch to that unit, walk outside and switch back. If you know a solution to this problem, please contact me.

TacView can be disabled at any time on any client with dceTacViewEnabled=FALSE;


ADMIN
For admins and local hosts, the tablet F2 key allows access to a simple admin menu. Access can be granted at the client level with dceAdmin=TRUE;


SCRIPTING
I do not provide scripting support. However, here is a basic starting guide:

1. Create Init.sqf in your mission folder.
2. In Init.sqf, put the following line:

execVM"Scripts\Start.sqf";

3. Create a folder called Scripts.
4. In Scripts, create Start.sqf.
5. At the top of Start.sqf, put this line:

waitUntil{!(isNil"dceReady")};waitUntil{dceReady};

6. Put any other code you desire under the above line. It will be executed on all clients.
7. https://community.bistudio.com/wiki/Category:Arma_3:_Editing


KNOWN BUGS
- Setting the formation direction does not make vehicles face that direction (BIS bug).
- Not a bug, but a limitation: Only a single group at a time can be given dialog orders (in HC you can select multiple groups and give orders).


LICENSE
https://www.bohemia.net/community/licenses/arma-public-license-share-alike

Brief summary of this Licence

PLEASE, NOTE THAT THIS SUMMARY HAS NO LEGAL EFFECT AND IS ONLY OF AN INFORMATORY NATURE DESIGNED FOR YOU TO GET THE BASIC INFORMATION ABOUT THE CONTENT OF THIS LICENCE. THE ONLY LEGALLY BINDING PROVISIONS ARE THOSE IN THE ORIGINAL AND FULL TEXT OF THIS LICENCE.

With this licence you are free to adapt (i.e. modify, rework or update) and share (i.e. copy, distribute or transmit) the material under the following conditions:

    Attribution - You must attribute the material in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the material).
    Noncommercial - You may not use this material for any commercial purposes.
    Arma Only - You may not convert or adapt this material to be used in other games than Arma.
    Share Alike - If you adapt, or build upon this material, you may distribute the resulting material only under the same license.

If you need an exception, feel free to contact me.


THEFT OF MY WORK
My artillery mod was stolen, edited and re-released in violation of the license by BlackAlpha of tier1ops.eu. Here is a video showing my original work and his stolen edit:

https://www.youtube.com/watch?v=Oe7G6WwxQVU

Please share this video and let the community know that BlackAlpha and tier1ops.eu are thieves.


CREDITS
Thank you very much to SaMara and Tonic-_- for allowing me to use their dialog code in earlier releases.
Drongo:			Concept and coding.
Chops:			Testing and input.
James:			Good advice, media stuff.
RootLocus:		Testing DT for OFP.
Sanctuary:		Help with DT for OFP.
Macser:			Help with DT for OFP.
Vektorboson:	Help with DT for OFP.
Grumpy Old Man:	For letting me use his code for spotting and reporting units.
Kenoxite:		Icons idea, some icons.
X39:			Telling me how to make the UI scale properly.
Gunter Serveloh:Testing
leopard20:		Help with getting TacView working.

Thanks to VedKay for his work behind the scenes.

A huge thanks to my Patrons and supporters:
Ahmad Fadhil Mohamed
Alexander Isaksson Norum
Alex Lacy
Andreas Nilson
Ave Sum
Azza
B. Hinton
Beags and Jam
Ben_at_Arms
Berl Ancell
Bretto1945
Bret Bothelio
Bruno Roberto Corrêa
Bullrich von Salz
Cedric Oliver
Chris Hall
Daniel Selby
David Catley
David Husa
David Kudýn
DavidSköld
Declan Emery
Desmond Abrams
Doctor
Elliot Taylor
EO
Fearmonger
Fetus114
Ferdinand
Frédérick Milhomme
Frosties
Gary Jackson
Gordon
gsg94490
Haakon Longbeard
Hogosha
Ian Schonely
Its_the_Jonah
James Hill
James tribbles
Jason Dotson
Jason Kieft
Jayrad
Jessica Ferguson
JimmyJamJams
Jonathan Harris
Karol Zaczek
Kelvin P
Kenneth Kilvington
Kevin Kelly
Logan Scott
LONEWOLF352
Longbeard
Marshall Bouldin
Matt Henderson
Magoo
MoonGuy
Nam
Nicholas Auger
Nicholas Odgers
Nick Gregory
Ole Petter Johnsen
Owen Siegfried
Paramarine Task Force
Paul T
Pernox
PHILLIP HARRIS
Proxno
Pusu npt
Ryan
Rolly uk
Roman Martinez
Sean Martin
sebastiaan reedijk
SETH BARCELLO
Sly
Slav_Man_Shae
Sonny Hermansen
Stuart Burling
swagggenius
Terrance
The One on the Rock
Timothy Hill
Tim O’Ceallaigh
Totem
tunou xiong
VedKay
ViperBAT46 DTF46
Wulf
WW3andMe
YonV
Zakuaz

Thanks also to the guys who post encouragement, bug reports and suggestions.

CONTACT
Most of my mods and missions are released on my Patreon page. You don't need to be a Patreon to download them: https://www.patreon.com/DrongoMods

Check my YouTube channel for trailers, WIP etc:
https://www.youtube.com/channel/UCrZtKPYPS9iYzu1EAzTLYgg

I am not on the BIS forums. I can be emailed at drongomods@gmail.com.

CHANGELOG
v0.522
Fixed:		Various issues

v0.521
Fixed: ?	Script error with some commands

v0.52
Added:		Optional SP respawn on side system
Changed:	TacView no longer automatically starts (use tablet F1)
Removed:	Fix animations button (was tablet F1)

v0.51
Fixed:		Reinforcements module was not deleting dummy vehicles

v0.5
Added:		Special icons for spotting spooks
Improved:	Several aspects of Reinforcements

v0.49
Added:		Options module can specify whether to hide unspotted groups in TacView
Fixed:		Script error when AI groups report casualties

v0.48
Fixed:		Dismount bugs
Fixed:		Always opening in Squad menu

v0.47
Added:		Objectives will be recognized by HAL NR6
Changed:	TacView garrison command now garrisons roof
Fixed:		Objective markers not changing colour with ownership

v0.46
Added:		Wide range of features for TacView

v0.45
Added:		Dedicated menu for TacView
Fixed:		Could not switch from TacView to Zeus in MP

v0.44
Added:		TacView, RTS-style interface based on Zeus
Fixed:		Various bugs

v0.431
Fixed:		Bug when selecting vehicles with another group as cargo

v0.43
Added:		Options module
Changed:	Using alt-click on a building will tell a group to garrison that building
Changed:	Using alt-click on a transport will tell a group to board that transport
Changed:	Markers now use correct NATO unit size markers
Improved:	Improved suppression command
Fixed:		Broken halt command
Fixed:		Various minor issues

v0.421
Changed:	Key to .dce
Fixed:		Units walking slowly after taking command

v0.42
Added:		ACE menu integration

v0.41
Fixed:		Incorrect marker name when using objectives

v0.4
Added:		Option to enable Zeus by tablet F6
Fixed:		Various bugs
Removed:	Obsolete objects

v0.322
Added:		Squad tablet F1 now provides a simple Admin interface for local hosts and admins (WIP)
Removed:	Dynamic Simulation option

v0.321
Added:		Command tablet F3 now toggles LAMBS danger on/off (no effect if not installed)
Changed:	Reported position of contacts is now usually given relative to locations such as towns etc

v0.32
Added:		gVar dceReportContact (set to false to disable contact reports)
Added:		Objectives now have an initial value for first capture
Fixed:		DRE infantry issues

v0.31
Changed:	The "has radio" check will now always pass if the player is in a vehicle
Changed:	Squad tablet F6 now toggles LAMBS danger on/off (no effect if not installed)

v0.3
Added:		Reinforcements now uses modules and is much more user-friendly to configure

v0.281
Fixed:		Various issues

v0.28
Fixed:		A lot of bugs with the reinforcements system
Fixed:		Losing CBA keybind for the DCE dialog (note: after changing the keybind, open the dialog once to save the bind)

v0.271
Fixed:		Fast rope script error

v0.27
Added:		Support for Duda's Advanced Rappelling (https://steamcommunity.com/sharedfiles/filedetails/?id=713709341)
Added:		Option to manually exclude groups from the command menu (tablet buttons F5 and F6)
Added:		Group resupply (dismounts will search bodies and crates or supply vehicles, vehicles will look for repair/refuel/rearm vehicles)
Added:		Clicking on a squad member now shows how many magazines he has
Changed:	Landing now asks for an LZ (map-click) and uses BIS_fnc_wpLand
Changed:	Add waypoint icon

v0.268
Fixed:		Command dialog unit duplication bug
Changed:	Landing command is now more forgiving

v0.267
Added:		dceAvailable to limit access to the entire system
Re-added:	dceCommandEnabled to limit access to command

v0.266
Hotfix for incompatibility with public release of Drongo's Artillery

v0.265
Changed:	General cleanup of the squad menu
Changed:	General cleanup of the command menu
Changed:	Completely rewrote the static pack/unpack scripts
Removed:	Several reduntant functions from the squad menu
Moved:		Dynamic Simulation, Fix Animations, Flip Vehicle, Unstuck and Interact Mode switched to the Fnc keys at the bottom of the tablet
Moved:		Teleport and Comms check moved to the F1/F2 keys along the bottom of the tablet
Fixed:		Other general bugfixes

v0.264
Changed:	The air key now opens Drongo's Air Operations instead of Drongo's Air Support
Changed:	Reinforcements icon

v0.263
Fixed: Drongo's Missile System missiles showing up in group dialogs

v0.262
Added: Drongo's Missile System icon to Squad menu (not enough space on the command menu)
Fixed: Drone anti-flee script disabling all drone AI-crewed systems

v0.261
Fixed: Sometimes it was possible to switch to dead units
Fixed: Facing wasn't working in the Command Dialog
Fixed: Bug with individual unit markers in Command
Changed: Force vehicle facing code
Removed: Force vehicle facing button

v0.26
Fixed: Alternate waypoint types not showing up in the command menu
Added: If DAPS is installed, pressing the DCE key will show how many charges remain
Fixed: Vehicles not popping smoke

v0.25
Further attempts to stop the "fleeing drone" problem

v0.24
Added DCE\Scripts\Core\KeyPressed.sqf (allows entering vehicles and switching to driver/gunner with R_SHIFT)

v0.23
I don't know

v0.22
Improved garrison (can now select any nearby house)
Light artillery system in case the user does not have Drongo's artillery installed
Various bugfixes

v0.21
Dialog now displays properly on all UI sizes (thanks X39)
Waypoint system updated and now has black lines from the group to each waypoint (like vanilla High Command)
Reinforcements system integrated at the addon level (can still customize with scripting)
Can now see individual markers for each man and vehicles in the selected group in Command
New markers for marking the individual men/vehicles in a squad
Can turn off reports of civilians
Improved "taking fire" markers
General tidy up, optimization and modernizing of code

v0.2
A few years worth of stuff. Most notably:
Added using the vanilla BIS tablet as the background
Added icons for nearly all buttons instead of text
Big overhaul of dialog code
Added doubleclicking units in the squad member list to switch to them
Added doubleclicking groups in the group list to switch to the leader
Added icon for Drongo's Reinforcements
Added garrison roof command
Too much other stuff to mention

v0.18
Command and Attach are now enabled by default
Added a definable Interact key
Added a definable Special key
Added Take Lead button (the player will become squad leader)
Added Marker and High Command buttons to the Squad menu
Added View Distance management buttons to the Squad menu
Added a Deploy Crew Served Weapon (DEP CSW) button to the Command menu (only works with vanilla assets)
Added a Teleport button to the Command menu to unfuck AI driving mishaps
Added a Force Markers button to the Command menu to try to unfuck my scripting (doesn't work very well)
Other minor stuff

v0.17
Overhauled squad menu code
Reverted F1-F4 keys to use text (can be configured by the user)

v0.16
Removed outdated "server loop" code for mounting and implemented BIS_fnc_execVM/BIS_fnc_MP code
Implemented "On my mark" (fire when I fire) (thanks to D4NI3L3 for the idea)
Implemented "Copy my stance" (thanks to D4NI3L3 for the idea)
Fixed the broken "Pop smoke" command

v0.152
Updated detection of the new version of Drongo's Artillery

v0.151 Hotfix
Fixed: Development script mode was left on in the addon version

v0.15
Changed the Squad Menu "Command" button to a commander's hat
Added a Garrison area command
Added a Garrison closest building command
Added more detail to spotting reports
Added a global variable to control the level of the detailed report (dceSpottingThreshold)
Added buttons to increase/decrease and reset view distance
Added an "Attach" option to the command menu
Fixed group registration so that newly formed groups are properly registered into BIS High Command

v0.14
Overhauled the "Target" command
Added a "Garrison" command (put your crosshair on the desired structure then click the icon)
Added user-configurable function keys F1 - F4 (see readme)

v0.13
Removed use of userconfig to set key, now uses the CBA system (this may have been implemented in an earlier release)
Replaced all squad menu text with icons
Added shortcuts for Drongo's Artillery and Drongo's Air Support to the squad menu
Removed some extraneous quick-action buttons (Aware, Hide, Take Cover)
Added a suppress button (uses the suppress scripting command)
Added a target button (not working well yet. Place your crosshair on the target, access the menu and click the button)

v0.12
Fixed a bug with the Heal Other command
Added the ability to exclude groups from command (using an array dceExclude). Note that HC will still show the unit's marker
Removed obsolete scripts DCE\Scripts\Command\CommsClient.sqf and \CommsPlayMessage.sqf
Fixed a bug that prevented the behaviour and formation of a group displaying in the command menu
Unexciting overhaul of group display and selection in the command dialog
Went through all of the core scripts to try to fix undefined variables and other misc bugs
Various small tweaks and bugfixes

v0.11
Added air units to spottable enemy units in DCE\Scripts\Command\Reporting\Spot.sqf
Fixed a bug that disallowed changing dceKey preference
Removed the reference to obsolete script DCE\Scripts\Command\Waypoints\MapClickEditPos.sqf

v0.1
Public release